
from ability.models import Gov, GovCourse, GovUser
from rest_framework import serializers

class GovSerializer(serializers.ModelSerializer):
	create_time = serializers.DateTimeField(format="%Y-%m-%d %H:%M:%S")
	class Meta:
		model = Gov
		fields = '__all__'
	
class GovCourseListSerializer(serializers.ModelSerializer):
	create_time = serializers.DateTimeField(format="%Y-%m-%d %H:%M:%S")
	gov_name = serializers.CharField(source='gov.name')
	course_name = serializers.CharField(source='course.course_name')

	class Meta:
		model = GovCourse
		fields = '__all__'

